package cn.wolfcode.wolf2w.domain;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Setter
@Getter
@Document("spot_ticket")
@ToString
public class Spot extends BaseDomain{
    private String name;
    private String traffic;
    @DateTimeFormat(pattern="HH:mm-HH:mm")
    private String openTime;
    private String tel;

    private String website;
    private String refTime;
    private String ticket;



    public String getJsonString(){
        Map<String,Object> map = new HashMap<>();
        map.put("id", super.getId());
        map.put("name", name);
        map.put("traffic",traffic);
        map.put("openTime",openTime);
        map.put("tel",tel);
        map.put("website",website);
        map.put("refTime",refTime);
        map.put("ticket",ticket);

        return JSON.toJSONString(map);
    }

}
